<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta content="text/html;charset=utf-8">
<title>项目成员列表</title></head>
<link href="resources/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="resources/bootstrap/css/bootstrap-theme.min.css" rel="stylesheet">
<link href="resources/css/index.css" rel="stylesheet">

<body>
	<s:include value="../header-common.jsp" />
<div class="container">
	<div class="row">
		<h1 style="text-align:center;text-shadow:1px 1px;">
			项目【${projectInfo.projectName }】成员列表
		</h1>
	</div>
	<div class="row">
		<s:set var="set" value="#{0:'未知',1:'男',2:'女'}"></s:set>
		<s:if test="queryErro.length() > 0">
			<div id="queryErroAlert" class="alert alert-danger col-sm-12 col-sm-offset-0">
				${queryErro }
			</div>
		</s:if>
		<div class="col-xs-12">
		<div class="btn-group btn-group-justified">
			<a href="projectDetail.do?projectId=${projectInfo.projectId }" 
				class="btn btn-primary">项目详情</a>
			<a href="projectList.do" class="btn btn-primary">项目列表</a>
		</div></div>
			<br><br>
		<s:form id="formPlayer" name="form" action="playerRemove" method="post" >
		<table class="table table-striped table-bordered table-hover table-condensed table-responsive">
		<tr class="success">
			<td class="textCenter">序号</td>
			<td class="textCenter">项目成员名称</td>
			<td class="textCenter">项目成员邮箱</td>
			<td class="textCenter">项目成员电话</td>
			<td class="textCenter">项目成员生日</td>
			<td class="textCenter">项目成员性别</td>
			<td class="textCenter">项目成员角色</td>
			<s:if test='user.role eq "项目经理"'>
				<td class="textCenter">操作</td>
			</s:if>
		</tr>
		<s:iterator value="listPlayer" var="list" begin="begin" end="end" status="status">
		<tr class="warning">
			<td><s:property value="%{#status.index+begin+1}"/></td>
			<td><s:property value="#list.employeeName"/></td>
			<td><s:property value="#list.employeeEmail"/></td>
			<td><s:property value="#list.contact"/></td>
			<td><s:property value="#list.birthday"/></td>
			<td><s:property value="#set[#list.sex]"/></td>
			<td><s:property value="%{list.role.roleName }"/></td>
			<s:if test='user.role eq "项目经理"'>
			<td class="textCenter">
				<button class="btn btn-info" data-toggle="tab" 
					onclick="playerRemove(${list.employeeId});">移除</button>
			</td>
			</s:if>
		</tr>
		</s:iterator>
		</table>
		<input id="employeeId" name="employeeId" style="display:none;" />
		</s:form> 
	</div>
	<div class="">
		<s:form id="formPage" name="form" action="toPage" method="post">
			<ul class="pagination" style="display:inline;">
				<s:if test="begin <= 1">
					<li class="disabled"><a>上一页</a></li>
				</s:if>
				<s:else>
					<li><a href="preProjectPage.do" title="上一页">上一页</a></li>
				</s:else>
				<s:bean name="org.apache.struts2.util.Counter">
					<s:param name="first" value= "1" />
				    <s:param name="last" value= "(listPlayer.size()-1)/10+1" />
				    <s:iterator status="status">
				    	<s:if test="#status.index==page-1">
				     	 	<li class="active"><a href="#" data-toggle="tab"
				     	 		onclick="toPage(this);"><s:property /></a></li>
				    	</s:if>
				    	<s:else>
				    		<li><a href="#" data-toggle="tab"
				    			onclick="toPage(this);"><s:property /></a></li>
				    	</s:else>
				    </s:iterator>
				</s:bean>
				<s:if test="end >= listPlayer.size()-1">
					<li class="disabled"><a>下一页</a></li>
				</s:if>
				<s:else>
					<li><a href="nextProjectPage.do" title="下一页">下一页</a></li>
				</s:else>
				<li>
					<input id="pageId" name="page" class="form-control" 
						style="float:left;width:50px;" value="${page }" />
					<input class="btn btn-primary" style="float:left;" type="submit" value="GO" />
				</li>
			</ul>
			
	    </s:form>
		</ul>
	</div>
</div>
	<script src="resources/bootstrap/js/jquery.min.js"></script>
	<script src="resources/bootstrap/js/bootstrap.min.js"></script>
	<script src="resources/js/common.js"></script>
</body>
</html>
